<%--
  Created by IntelliJ IDEA.
  User: yiyi
  Date: 2018/8/15
  Time: 14:26
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<html>
<head>
    <title>会员管理</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath }/css/bootstrap.css"/>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.min.js"></script>
</head>
<body>

    <form id="form" action="/CvipServlet" method="get" >

        <table class="table table-hover">
            <tr class="warning">
                <td> <label for="ename">用户名:</label></td>
                <td>
                    <input type="text" name="name" class="form-control" id="ename" placeholder="会员名称" />
                    <div id="showItemsName">

                    </div>
                </td>
                <td>
                    <input type="submit"class="btn btn-success" value="查询"/>
                </td>
            </tr>
        </table>
    </form>
    <h3 class="text-center text-info">${error}</h3>
    <form  action="/CvipServlet" method="get"  id="pg">
        <input type="hidden" name="currentPage" id="cp" >
        <c:if test="${pageBean.totalCount >0}">
        <table class="table">
            <tr class="active">
                <td>序号</td>
                <td>用户名</td>
                <td>用户类别</td>
                <td>用户状态</td>
                <td>最后修改时间</td>
            </tr>
            </c:if>
            <c:forEach items="${pageBean.list}" var="item" varStatus="i">
                <tr class="success">
                    <td>
                       ${i.index+1 }
                    </td>
                    <td>
                            ${item.name }
                    </td>
                    <td>
                            ${item.typename }
                    </td>
                    <td>
                            ${item.typestaus }
                    </td>
                    <td>
                            ${item.lastModifyTime}
                    </td>
                </tr>
            </c:forEach>

        </table>
    </form>
    <ul class="pagination pagination-lg " style="margin-left: 30px">

            <li><a href="javascript:pages(1);">首页</a></li>
            <li><a href="javascript:pages(${pageBean.currentPage - 1});">上一页</a></li>
            <li><a href="javascript:pages(${pageBean.currentPage + 1});">下一页</a></li>
            <li><a href="javascript:pages(${pageBean.totalPage});">末页</a></li>
        <li>
            <a href="#">第${pageBean.currentPage}页</a>
        </li>
        <li>
            <a href="#">共${pageBean.totalPage}页</a>
        </li>
        <li>
            <a href="#">${pageBean.totalCount}条数据</a>
        </li>
    </ul>

</body>
<script>
    function pages(number) {
        var cp = document.getElementById("cp");
        cp.value = number;
        if (cp.value)
        var from=  document.getElementById("pg");
        from.submit();
    };
</script>
</html>
